package com.dimple.project.system.controller;

import com.dimple.framework.web.controller.BaseController;
import com.dimple.framework.web.page.TableDataInfo;
import com.dimple.project.system.domain.Config;
import com.dimple.project.system.service.ConfigService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("system/config")
public class ConfigController  extends BaseController {

    private  final ConfigService configService;

     public ConfigController(ConfigService configService){
         this.configService = configService;
     }


    @PreAuthorize("@permissionService.hasPermission('system:config:list')")
    @GetMapping("/list")
    public TableDataInfo list(Config config) {
        startPage();
        List<Config> list = configService.selectConfigList(config);
        return getDataTable(list);
    }




}
